package utgame.com.fakelegendary.container;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import utgame.com.fakelegendary.model.Ball;
import utgame.com.fakelegendary.model.Hero;

/**
 * Created by xueal on 2018/1/23.
 */

public class HeroManager {

    private static final HeroManager single = new HeroManager();
    public static HeroManager getInstance() {
        return single;
    }

    private Map<String, Hero> mHeroMap = new HashMap<>();

    public Map<String, Hero> getAllHero(){
        return mHeroMap;
    }
    public Hero getHero(String heroName){
        return mHeroMap.get(heroName);
    }

    public void updateHero(String heroName, float x, float y, float r){
        mHeroMap.put(heroName, new Hero(heroName, new Ball(x, y, r)));
    }
    public void removeHero(String heroName){
        mHeroMap.remove(heroName);
    }


}
